import request from '@/utils/request'
const req = request.service;

export default{
    queryDeptTree(data){

        const postData = data || {}
        return req({
            url: "/dept/tree",
            method: 'post',
            data:postData
        })
    },
    queryDept(data){

        const postData = data || {}
        return req({
            url: "/dept",
            method: 'post',
            data:postData
        })
    },
    delDept(data){
        return req({
            url: '/dept/delete',
            method: 'post',
            data:data
        })
    },
    saveDept(data){
        return req({
            url: data.bmbh?'/dept/save':'/dept/add',
            method: 'post',
            data:data
        })
    },
    queryUser(data){
        const postData = data || {}
        return req({
            url: "/dept/user",
            method: 'post',
            data:postData
        })
    },
    editUsersDept(data){
        return req({
            url: "/dept/user/edit",
            method: 'post',
            data:data
        })
    },
    addUser(data){
        return req({
            url: "/dept/user/add",
            method: 'post',
            data:data
        })
    },
    delUser(data){
        return req({
            url: "/dept/user/delete",
            method: 'post',
            data:data
        })
    }
}